package com.design.merlin.compositepattern;

/**
 * @author Merlin
 * @Title: Ciyrse
 * @ProjectName java-base-learning
 * @Description: 课程类
 * @date 2019/3/615:37
 */
public class Course extends CatalogComponent{

    private String name;
    private double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CatalogComponent catalogComponent) {
        return this.name;
    }

    @Override
    public double getPrice(CatalogComponent catalogComponent) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("Course Name :"+name+" price :"+price);
    }
}
